package com.binyouwei.designpatterns.creation_type.abstract_factory;

/**
 * @author 宾有为
 * @date 2024/7/18 19:32
 * @link https://blog.csdn.net/baidu_41616022?type=blog
 * @describe：抽象工厂模式 - 提供一个接口，用于创建一系列相关或依赖对象，而无需指定它们的具体类。
 **/
public class AbstractFactoryMain {
    public static void main(String[] args) {
        AbstractFactory factory = new AbstractFactoryCarFactory();
        AbstractFactoryVehicle vehicle = factory.createVehicle();
        vehicle.drive();

        factory = new AbstractFactoryMotorcycleFactory();
        vehicle = factory.createVehicle();
        vehicle.drive();
    }
}
